version 18.0               // version control
set processors 8           // to ensure replicability across different numbers of cores
clear all                  // clear existing data
macro drop _all            // and macros, clean slate
set seed 20220613          // set seed

*-------------------------------------------------------
* project: daylight saving time (dst)
*-------------------------------------------------------

local pgm  "dst-data01_acs_marital_status_clean"          // file name
local who  "Muzhe Yang"                                   // author
local dte  "2022-06-13"                                   // created date
local dte2 "`c(current_date)'"                            // last run date
local tag  "`pgm'.do, created by `who' on `dte', last run on `dte2'"

capture log close
log using "code\management\\`pgm'.txt", replace text
display "`tag'"

import excel "data_raw\acs\acs_marital_status.xlsx", sheet("acs_marital_status") firstrow clear

gen double married = B12001_calc_numMarriedE
gen double married_pct = B12001_calc_pctMarriedE

label variable married     "total married"
label variable married_pct "% married"

order married married_pct, after(County)
keep GEOID State County /// 
     married married_pct
codebook, compact
compress
save "data_clean\acs\\`pgm'.dta", replace 

log close
exit